<?
include_class('m2');
include_class('band_diaries');
$bm = $args['member'];
$activeID = $args['activeID'];
$uo = $bm->getUserObject();
$firstName = $uo->getFirstName();
$lastName = $uo->getLastName();
$id = $bm->getID();
$role = $bm->getRole();
$equipment = $bm->getEquipment();
$birthdate = $uo->getBirthDate("F d, Y");
$influences = $bm->getInfluences();
$email = $uo->getEmailAddress();
$bio = $bm->getBio();

$photoArea = $bm->getPhotoAreaObject();
if (!db::isError($photoArea)) {
	$numPhotos = $photoArea->getNumFiles();
	if ($numPhotos > 0) {
		$photos = new SectionTemplate;
		$photos->file = "gallery.php";
		$photos->args['area'] = &$photoArea;
		if (USE_MOD_REWRITE) {
			$photos->args['url'] = '/member/' . $bm->getID() . '/';
		} else {
			$photos->args['url'] = '/band.php?id=' . $bm->getID();
		}
	}
}

$avArea = $bm->getAVAreaObject();
if (!db::isError($avArea)) {
	$numAudio = $avArea->getNumFiles();
	if ($numAudio > 0) {
		$av = new SectionTemplate;
		$av->file = "media_list.php";
		$av->args['area'] = &$avArea;
		if (USE_MOD_REWRITE) {
			$av->args['url'] = '/member/' . $bm->getID() . '/';
		} else {
			$av->args['url'] = '/band.php?id=' . $bm->getID();
		}
	}
}

$latestDiary = $bm->getLatestDiaryObject();
if (!db::isError($latestDiary) && is_object($latestDiary)) {
	$diary = new SectionTemplate;
	$diary->file = "band_diary_detail.php";
	$diary->args['diary'] = $latestDiary;
}

$moreDiariesLink = (USE_MOD_REWRITE) ? '/member/diaries/' : 'band.php?id=' . $bm->getID() . '&diaries=1';
?>